import { Vector3 } from "@/utils/Vector3"
import { CustomElement } from "@/js/components/CustomElement"

export class Text extends CustomElement{
    text = "";
    
    constructor(text:any=""){
        super();
        this.setTag("div");

        this.setText(text);

        this.setStyle({
            display: "inline-block"
        });
    }

    setText(text:any){
        this.$el.innerText = text;
        this.text = text;
        return this;
    }

    setHtml(text:string){
        this.$el.innerHTML = text;
        this.text = text;
        return this;
    }

    setColor(color:string){
        this.setStyle({
            color, 
        });

        return this;
    }

    setFontSize(size:string){
        this.setStyle({
            "font-size":size, 
        });

        return this;
    }
}